package com.atguigu.gulimall.product.feign;

import com.atguigu.common.to.SkuReductionTo;
import com.atguigu.common.to.SpuBoundTo;
import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 远程调用优惠卷服务接口
 *
 * @author Angel
 * @email 11217304@gmail.com
 * @date 2021/7/26
 */
@FeignClient("gulimall-coupon")
public interface CouponFeignService {
    /**
     * 保存spu的积分信息  gulimall_sms -> sms_spu_bounds
     * 1、@RequestBody 将对象转为json
     * 2、找到gulimall-coupon服务  给/coupon/spubounds/save接口发送请求
     * 3、对方服务收到请求  响应
     *
     * @param spuBoundTo
     * @return
     */
    @PostMapping("/coupon/spubounds/save")
    R savaSpuBounds(@RequestBody SpuBoundTo spuBoundTo);

    /**
     * 保存 sku的优惠、满减等信息
     * @param skuReductionTo
     * @return
     */
    @PostMapping("/coupon/skufullreduction/saveInfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
